package co.gov.mintic.inmueblesdisponibles.android;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;

/**
 * Boton usado para ingresar a la pantalla de Filtros
 * @author Benjamin
 *
 */
public class LocalizarInmuebles extends ImageButton {

    public LocalizarInmuebles(Context context) {
        super(context);
    }

    public LocalizarInmuebles(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public LocalizarInmuebles(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void init(final Activity activity) {
        setBackgroundColor(Color.TRANSPARENT);
        setOnClickListener(new ButtonLocalizarOnClickListener(activity));
    }

    private final class ButtonLocalizarOnClickListener implements OnClickListener {
    	
    	Activity activity;
    	
    	public ButtonLocalizarOnClickListener(Activity activity) {
			// TODO Auto-generated constructor stub
    		this.activity = activity;
		}
        /*
         * Source Tag: login_tag
         */
        @Override
        public void onClick(View arg0) {
			Intent hackbookIntent = new Intent().setClass(activity, Filtros.class);
			activity.startActivity(hackbookIntent);
        }
    }

}
